﻿using TestingConcurrencyBenchmark.Benchmarks.BenchmarkTests;
using TestingConcurrencyBenchmark.ProblemFactories;
using TestingConcurrencyBenchmark.Problems.DiningPhilosophers.DiningPhilosophersSolutions;

namespace TestingConcurrencyBenchmark.Benchmarks
{
    public class DiningPhilosophersBenchmark : AbstractBenchmark<AbstractDiningPhilosophers>
    {
        private readonly int _nbThreads;

        public DiningPhilosophersBenchmark(int nbThreads) : base(new DiningPhilosophersFactory(nbThreads))
        {
            _nbThreads = nbThreads;
        }

        protected override BenchmarkTest<AbstractDiningPhilosophers> CreateBenchmarkTest(AbstractDiningPhilosophers solution)
        {
            return new DiningPhilosophersTest(solution, _nbThreads);
        }
    }
}